package br.eng.eliseu.gwt.gestaoWeb.server.command.generico;

import java.io.Serializable;

import br.eng.eliseu.gwt.gestaoWeb.model.BaseEntity;
import br.eng.eliseu.gwt.gestaoWeb.server.command.BaseCommand;

@SuppressWarnings("all")
public class GetEntityCommand extends BaseCommand<BaseEntity> /*implements Callable<BaseEntity>*/{

//	@Inject private EntityManager em;
	
	private Serializable id;
	
	private Class clazz;
	
	public BaseEntity call() {
		BaseEntity entity = (BaseEntity) getEntityManager().find(clazz, id); 
		return entity;
	}

	public Serializable getId() {
		return id;
	}

	public void setId(Serializable id) {
		this.id = id;
	}

	public Class getClazz() {
		return clazz;
	}

	public void setClazz(Class clazz) {
		this.clazz = clazz;
	}

//	public void setEm(EntityManager em) {
//		this.em = em;
//	}
//
//	public EntityManager getEm() {
//		return em;
//	}

}
